#include <iostream>

int continumax(char **outstr, char *instr)
{
    *outstr = instr;

    if (*instr == '\0') {
        return 0;
    }

    char *p = instr;
    char *pre = p++;
    int len = 1;
    int maxlen = 1;

    while (*p != '\0') {
        if (*p == *pre + 1) {
            len++;

            if (len > maxlen) {
                maxlen = len;
                *outstr = p - maxlen + 1;
            }
        } else {
            len = 1;
        }

        pre = p;
        p++;
    }

    return maxlen;
}

int main(int argc, const char *argv[])
{
    char *instr = "abcd12345ed125ss123456789";
    char *outstr = NULL;
    int len = continumax(&outstr, instr);

    for (int i = 0; i < len; ++i) {
        std::cout << outstr[i];
    }

    std::cout << std::endl;
    return 0;
}
